package com.lss.study.component;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 功能描述：
 *
 * @Date: 2021/3/11 0:23
 */
@Component
public class OrderAutoCancle {
    private Logger LOGGER = LoggerFactory.getLogger(OrderAutoCancle.class);

    /**
     * cron表达式：Seconds Minutes Hours DayofMonth Month DayofWeek [Year]
     * 每10分钟扫描一次，扫描设定超时时间之前下的订单，如果没支付则取消该订单
     */
    @Scheduled(cron = "0/20 * * ? * ?")
    private void cancelTimeOutOrder() {
        LOGGER.info("扫描订单");
    }
}
